/**
* @Author: Rain
* @Date: 2022/01/19 14:41:26
* @LastEditTime: 2023/11/04 20:25:10
* @Description: Do Something
 */
import axios from 'axios'
import { getToken } from '@/utils/auth'

export function upload(api, file, params) {
  var data = new FormData()
  data.append('file', file)
  if (params) {
    for (const key in params) {
      data.append(key, params[key])
    }
  }
  const config = {
    headers: { Authorization: getToken() }
  }
  return axios.post(api, data, config)
}
